package com.yunfei.common.auto.createClass.oracle;


import com.yunfei.common.auto.GeneratorBase;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;
import java.util.Date;

public class GeneratorToIbatisXmlForOracle extends GeneratorBase {
	/*
	 * 构造函数
	 */
	public GeneratorToIbatisXmlForOracle(){
    	//创建连接
    	Connection con;
		//查要生成实体类的表
    	String sql = "select * from " + tablename;
    	PreparedStatement pStemt = null;
    	try {
    		try {
				Class.forName(DRIVER);
			} catch (ClassNotFoundException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
    		con = DriverManager.getConnection(URL,NAME,PASS);
			pStemt = con.prepareStatement(sql);
			ResultSetMetaData rsmd = pStemt.getMetaData();
			int size = rsmd.getColumnCount();	//统计列
			colnames = new String[size];
			colTypes = new String[size];
			colSizes = new int[size];
			for (int i = 0; i < size; i++) {
				colnames[i] = rsmd.getColumnName(i + 1);
				colTypes[i] = rsmd.getColumnTypeName(i + 1);
				if(colTypes[i].equalsIgnoreCase("datetime")){
					f_util = true;
				}
				if(colTypes[i].equalsIgnoreCase("image") || colTypes[i].equalsIgnoreCase("text")){
					f_sql = true;
				}
				colSizes[i] = rsmd.getColumnDisplaySize(i + 1);
			}
			
			String content = parsexml(colnames,colTypes,colSizes);
			
			try {
				File directory = new File("");
				//System.out.println("绝对路径："+directory.getAbsolutePath());
				//System.out.println("相对路径："+directory.getCanonicalPath());
				String path=this.getClass().getResource("").getPath();
				
				System.out.println(path);
				System.out.println("src/?/"+path.substring(path.lastIndexOf("/com/")) );
				tablename=replaceUnderlineAndfirstToUpper(tablename.toLowerCase(),"_","");
//				String outputPath = directory.getAbsolutePath()+ "/src/"+path.substring(path.lastIndexOf("/com/", path.length()), path.length()) + initcap(tablename) + ".java";
				String outputPath = MYBATIS_PATH+initcap(tablename) + "Mapper.xml";
				File file = new File(outputPath);
				file.getParentFile().mkdirs();
				FileWriter fw = new FileWriter(outputPath);
				PrintWriter pw = new PrintWriter(fw);
				pw.println(content);
				pw.flush();
				pw.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		} finally{
//			try {
//				con.close();
//			} catch (SQLException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
		}
    }

	/**
	 * 功能：生成实体类主体代码
	 * @param colnames
	 * @param colTypes
	 * @param colSizes
	 * @return
	 */
	private String parse(String[] colnames, String[] colTypes, int[] colSizes) {
		StringBuffer sb = new StringBuffer();
		sb.append("package " + packageOutPath + ";\r\n");
		//判断是否导入工具包
		sb.append("import java.util.*;\r\n");
		if(f_util){
			sb.append("import java.util.Date;\r\n");
		}
		if(f_sql){
			sb.append("import java.sql.*;\r\n");
		}
		sb.append("\r\n");
		//注释部分
		sb.append("   /**\r\n");
		tablename=replaceUnderlineAndfirstToUpper(tablename.toLowerCase(),"_","");
		sb.append("    * "+tablename+" 实体类\r\n");
		sb.append("    * "+new Date()+" "+this.authorName+"\r\n");
		sb.append("    */ \r\n");
		//实体部分
		sb.append("\r\n\r\npublic class " + initcap(tablename) + "{\r\n");
		processAllAttrs(sb);//属性
		processAllMethod(sb);//get set方法
		boToEntity(sb);
		entityToBo(sb);
		sb.append("}\r\n");
		
    	//System.out.println(sb.toString());
		return sb.toString();
	}
	/**
	 * ibatis xml文件自动生成
	 *@title
	 *@date 2014-9-18
	 *@author ZhengYunfei
	 * @param colnames
	 * @param colTypes
	 * @param colSizes
	 * @return
	 */
	public String parsexml(String[] colnames, String[] colTypes, int[] colSizes){
		StringBuffer sb = new StringBuffer();
		String pkColumn="";
		//生成ibatis头文件
		sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n" );
		sb.append("<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\r\n");
		String tableName=replaceUnderlineAndfirstToUpper(tablename.toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
		sb.append("\r\n<mapper namespace=\""+ packageOutPathMapper+"."+initcap(tableName)+"Mapper\">\r\n");
		//sb.append("<typeAlias alias=\""+initcap(tableName)+"Entity\" type=\""+this.packageOutPath+".entity."+initcap(tableName)+"Entity\"/>\r\n");
		//生成resultMap

	    sb.append("<resultMap type=\""+ ENTITY_PATH+"."+initcap(tableName)+"Entity\""+" id=\""+initcap(tableName)+"Map\">\r\n");
	    String orderByColumn="";
	    for (int i = 0; i < colnames.length; i++) {
	    	if(colnames[i].equals("isOrderBy")){
				orderByColumn=colnames[i];
			}
			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
			sb.append("\t<result property=\"" + colname + "\" column=\"" + colnames[i] + "\"/>"); 
			sb.append("\n");
		}
	    sb.append("</resultMap>\r\n");
	    //生成公共的参数
		sb.append("\t<sql id=\"tableName\">\n" +
				"\t\t"+tablename.toUpperCase()+"\n" +
				"\t</sql>\n" +
				"\t<sql id=\"Base_Column_List\">\r\n");
                for (int i = 0; i < colnames.length; i++) {
                    sb.append("\t\t"+colnames[i]);
                    if(i<colnames.length-1){
                        sb.append(",\r\n");
                    }
                }
		sb.append(
				"\r\n\t</sql>\n" +
				"\t<sql id=\"querySql\">\n" +
				"\t\t<where>\n");
		pkColumn=colnames[0];
		for (int i = 0; i < colnames.length; i++) {

			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
			sb.append("\t\t\t<if test=\""+colname+"!=null and "+colname+"!=''\">\n");
			sb.append("\t\t\t\tAND "+colnames[i]+"=#{"+colname+"}\n");
			sb.append("\t\t\t</if>\n");
		}
		sb.append("\t\t</where>\n" +
				"\t</sql>\n");
				sb.append("\t<sql id=\"updateSql\">\n" +
				"\t\t<set>\n");
				for (int i = 1; i < colnames.length; i++) {
					String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
					sb.append("\t\t\t<if test=\""+colname+"!=null and "+colname+"!=''\">\n");
					if(colname.contains("DATE")){
						sb.append("\t"+colnames[i]+"=to_date(#{" + colname + ",jdbcType=VARCHAR},\'yyyy-MM-dd HH24:mi:ss\'),\t\r\n");
					}else{
						sb.append("\t\t\t\t "+colnames[i]+"=#{"+colname+"},\n");
					}

					sb.append("\t\t\t</if>\n");
				}
				sb.append(
				"\t\t</set>\n" +
				"\t</sql>\n" +
				"\t<!--排序sql-->\n" +
				"\t<sql id=\"orderBySql\">\n" +
				"\t\t<choose>\n" +
				"\t\t\t<when test=\"field != null and order !=null\">\n" +
				"\t\t\t\tORDER BY ${field} ${order}\n" +
				"\t\t\t</when>\n" +
				"\t\t\t<otherwise>\n" +
				"\t\t\t\tORDER BY "+pkColumn+"\n" +
				"\t\t\t</otherwise>\n" +
				"\t\t</choose>\n" +
				"\t</sql>\n" +
				"\t<!--分页sql-->\n" +
				"\t<sql id=\"pageSql\">\n" +
				"\t\t<choose>\n" +
				"\t\t\t<when test=\"curSize>=1\">\n" +
				"\t\t\t\t<![CDATA[<= #{curSize}) WHERE RN >#{curNo}\t]]>\n" +
				"\t\t\t</when>\n" +
				"\t\t\t<otherwise>\n" +
				"\t\t\t\t<![CDATA[\t<= 20) WHERE RN >= 0\t]]>\n" +
				"\t\t\t</otherwise>\n" +
				"\t\t</choose>\n" +
				"\t</sql>\n");
	    //插入查询语句

	    sb.append("<!--查询所有列表-->\r\n");
	    sb.append("\r\n<select id='findAllList' resultMap='"+initcap(tableName)+"Map'>\r\n");

	    sb.append("SELECT\r\n");
		sb.append("\t\t<include refid=\"Base_Column_List\"/>\n");
	    sb.append("FROM\r\n");
	    //生成表名参数
	  	sb.append("\t<include refid=\"tableName\"/>\n");
	  	//生成查询语句参数
		sb.append("\t<include refid=\"querySql\"/>\n");
		//生成排序参数
		sb.append("\t<include refid=\"orderBySql\"/>\r\n");

		sb.append("\n</select>\r\n");

		sb.append("<!--查询分页所有列表-->\r\n");
		sb.append("\r\n<select id='findAllListPage' resultMap='"+initcap(tableName)+"Map'>\r\n");
		sb.append("SELECT * FROM \n" +
				" ( SELECT A.*, ROWNUM RN   FROM  \n" +
				" (");
		sb.append("SELECT\r\n");
		sb.append("\t\t<include refid=\"Base_Column_List\"/>\n");
		sb.append("FROM\r\n");
		//生成表名参数
		sb.append("\t<include refid=\"tableName\"/>\n");
		//生成查询语句参数
		sb.append("\t<include refid=\"querySql\"/>\n");
		//生成排序参数
		sb.append("\t<include refid=\"orderBySql\"/>\r\n");
		sb.append("\t\t ) A   WHERE ROWNUM \n");
		//生成分页参数
		sb.append("\t<include refid=\"pageSql\"/>");
		sb.append("\n</select>\r\n");

	    //查询findById
		sb.append("<!--根据id查询bo-->\r\n");
		sb.append("\r\n<select id='get' resultMap='"+initcap(tableName)+"Map'>\r\n");
		sb.append("SELECT\r\n");
		//生成基础列
		sb.append("<include refid=\"Base_Column_List\"/>\r\n");
		sb.append("FROM \r\n");
		//生成表名参数
		sb.append("<include refid=\"tableName\"/>\n");
		sb.append("WHERE\r\n");
		String pk=colnames[0];//主键列
		String property=replaceUnderlineAndfirstToUpper(pk.toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
		sb.append(""+pk+"=#{"+property+"}\r\n");
		sb.append("</select>\r\n");
		//查询findByMap
		sb.append("<!--根据id查询bo-->\r\n");
		sb.append("\r\n<select id='findByMap' resultMap='"+initcap(tableName)+"Map'>\r\n");
		sb.append("SELECT\r\n");
		//生成基础列
		sb.append("<include refid=\"Base_Column_List\"/>\r\n");
		sb.append("FROM \r\n");
		//生成表名参数
		sb.append("<include refid=\"tableName\"/>\n");
		sb.append("WHERE\r\n");
		sb.append(""+pk+"=#{"+property+"}\r\n");
		sb.append("</select>\r\n");
	    //插入查询个数
		sb.append("<!--查询-->\r\n");
		sb.append("\r\n<select id='count' resultType='java.lang.Integer'>\r\n");
		sb.append("SELECT\r\n");
		sb.append("\tCOUNT(0)\r\n");
		sb.append("FROM \r\n");
		//生成表名参数
		sb.append("<include refid=\"tableName\"/>\n");
		sb.append("<include refid=\"querySql\"/>");
		sb.append("\r\n</select>\r\n");
		//查询findByBo
		sb.append("<!--根据id查询bo-->\r\n");
		sb.append("\r\n<select id='findByBo' resultMap='"+initcap(tableName)+"Map'>\r\n");
		sb.append("SELECT\r\n");
		//生成基础列
		sb.append("<include refid=\"Base_Column_List\"/>\r\n");
		sb.append("FROM \r\n");
		//生成表名参数
		sb.append("<include refid=\"tableName\"/>\n");
		sb.append("<include refid=\"querySql\"/>\n");
		sb.append("</select>\r\n");
	    //新增语句
	    sb.append("<!--新增-->\r\n");
	    sb.append("<insert id=\"add\" parameterType=\""+ ENTITY_PATH+"."+initcap(tableName)+"Entity\">\r\n");
	    sb.append("\tINSERT INTO <include refid=\"tableName\"/>(\r\n");
	   	sb.append("\t<include refid=\"Base_Column_List\"/>\r\n");
	    sb.append(")VALUES(\r\n");
	    for (int i = 0; i < colnames.length; i++) {
			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
				if (i < colnames.length - 1) {
					if(colname.contains("Date")){
						sb.append("\tto_date(#{" + colname + ",jdbcType=VARCHAR},\'yyyy-MM-dd HH24:mi:ss\'),\t\r\n");
					}else{
						sb.append("\t#{" + colname + ",jdbcType=VARCHAR},\t\r\n");
					}

				} else {
					if(colname.contains("Date")){
						sb.append("\tto_date(#{" + colname + ",jdbcType=VARCHAR},\'yyyy-MM-dd HH24:mi:ss\')\t\r\n");
					}else{
						sb.append("\t#{" + colname + ",jdbcType=VARCHAR}\t\r\n");
					}

				}
		}
	    sb.append(")\r\n");
/*	    sb.append("<selectKey resultClass=\"java.lang.String\" keyProperty=\"id\" >\n" +
				"\t\t\tSELECT LAST_INSERT_ID() AS id\n" +
				"\t\t</selectKey>\r\n");*/
	    sb.append("</insert>\r\n");
	    //批量插入mybatis start
		//			sb.append("<insert id=\""+namespace+"batchInsert\" parameterClass=\"java.util.List\">\n");
		//			sb.append("\tINSERT INTO "+tablename+"(\r\n");
		//			for (int i = 0; i < colnames.length; i++) {
		//				if(!colnames[i].equals("id")){
		//					if(i<colnames.length-1){
		//						sb.append("\t"+colnames[i] +",\t\r\n");
		//					}else{
		//						sb.append("\t"+colnames[i] +"\t\r\n");
		//					}
		//				}
		//			}
		//			sb.append("\t\t)\r\n");
		//				sb.append("\t\tSELECT A.*\n" +
		//				"\t\tFROM\n" +
		//				"\t\t(\n" +
		//				"\t\t<foreach collection=\"list\" item=\"item\" index=\"index\" separator=\"UNION ALL\">\n" +
		//				"\t\t\tSELECT\n");
		//				for (int i = 0; i < colnames.length; i++) {
		//					//String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
		//					String colname=colnames[i].toUpperCase();
		//					if (i < colnames.length - 1) {
		//						if(colname.equals("createTime")){
		//							sb.append("\tnow(),\t\r\n");
		//						}else{
		//							sb.append("\t#{item." + colname + "},\t\r\n");
		//						}
		//
		//					} else {
		//						if(colname.equals("createTime")) {
		//							sb.append("\tnow()\t\r\n");
		//						}else{
		//							sb.append("\t#{item." + colname + "}\t\r\n");
		//						}
		//
		//					}
		//				}
		//				sb.append(
		//				"\t\t\tFROM\n" +
		//				"\t\t\tdual\n" +
		//				"\t\t</foreach>\n" +
		//				"\t\t) A\n" +
		//				"\t</insert>");
		//		//批量插入mybatis end
		//批量插入ibatis start
		sb.append("<insert id=\"batchInsert\" parameterType=\"java.util.List\">\n");
		sb.append("\tINSERT INTO <include refid=\"tableName\"/>(\r\n");
		sb.append("\t<include refid=\"Base_Column_List\"/>\r\n");
		sb.append("\t\t)\r\n");
		sb.append("\tSELECT A.*\n" +
				"\tFROM (\n");
		sb.append("\t\t<foreach collection=\"list\" item=\"item\"   separator =\"UNION ALL\">\r\n");
		//sb.append("\t\t(\r\n");
		sb.append("\t\tSELECT\t\n");
		for (int i = 0; i < colnames.length; i++) {
			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
			//String colname=colnames[i].toUpperCase();
			if (i < colnames.length - 1) {
                sb.append("\t\t\t#{item." + colname + "},\t\r\n");

			} else {
                sb.append("\t\t\t#{item." + colname + "}\t\r\n");

			}
        }
			sb.append("\t\tFROM  dual\r\n");

		//sb.append(")\n");
        sb.append("\t</foreach >\r\n");
        sb.append("\t\t) A\r\n");
		sb.append("\t</insert>\r\n");
		//批量插入ibatis end
	    //修改
	    sb.append("<!--修改-->\r\n");
	    sb.append("<update id=\"update\" parameterType=\""+ ENTITY_PATH+"."+initcap(tableName)+"Entity\">\r\n");
	    sb.append("\tUPDATE\r\n");
	    sb.append("<include refid=\"tableName\"/>\r\n");
	    sb.append("<include refid=\"updateSql\"/>\r\n");
		sb.append(" \tWHERE \r\n");
		sb.append("\t"+pk+"=#{"+property+"}\r\n");
		sb.append("</update>\r\n");
		//删除
		sb.append("<!--删除-->\r\n");
		sb.append("<delete id=\"delete\" parameterType=\"java.util.Map\">\r\n");
		sb.append("\tDELETE FROM \r\n");
		sb.append("\t\t<include refid=\"tableName\"/>\r\n");
		sb.append("\tWHERE\r\n");
		sb.append("\t\t"+pk+" IN\r\n");
		sb.append("\t\t<foreach collection=\"id\" item=\"arr\" index=\"no\" open=\"(\"\n" +
				"             separator=\",\" close=\")\">\n" +
				"        #{arr}\n" +
				"    </foreach>\r\n");
		sb.append("</delete>\r\n");
	    sb.append("</mapper>");
	    return sb.toString();
	}
	/**
	 * 功能：生成所有属性
	 * @param sb
	 */
	private void processAllAttrs(StringBuffer sb) {
		
		for (int i = 0; i < colnames.length; i++) {
			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
			sb.append("\tprivate " + sqlType2JavaType(colTypes[i]) + " " + colname+ ";\r\n");
		}
		
	}
	/** 
	* 首字母大写 
	*  
	* @param srcStr 
	* @return 
	*/  
	public static String firstCharacterToUpper(String srcStr) {  
	   return srcStr.substring(0, 1).toUpperCase() + srcStr.substring(1);  
	}  
	/** 
	* 替换字符串并让它的下一个字母为大写 
	* @param srcStr 
	* @param org 
	* @param ob 
	* @return 
	*/  
	public static String replaceUnderlineAndfirstToUpper(String srcStr,String org,String ob)  
	{  
	   String newString = "";  
	   int first=0;  
	   while(srcStr.indexOf(org)!=-1)  
	   {  
	    first=srcStr.indexOf(org);  
	    if(first!=srcStr.length())  
	    {  
	     newString=newString+srcStr.substring(0,first)+ob;  
	     srcStr=srcStr.substring(first+org.length());
	     srcStr=firstCharacterToUpper(srcStr);  
	    }  
	   }  
	   newString=newString+srcStr;  
	   return newString;  
	}  
	/**
	 * 功能：生成所有方法
	 * @param sb
	 */
	private void processAllMethod(StringBuffer sb) {
		
		for (int i = 0; i < colnames.length; i++) {
			String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
			sb.append("\tpublic void set" + initcap(colname) + "(" + sqlType2JavaType(colTypes[i]) + " " + 
					colname + "){\r\n");
			sb.append("\tthis." + colname + "=" + colname + ";\r\n");
			sb.append("\t}\r\n");
			sb.append("\tpublic " + sqlType2JavaType(colTypes[i]) + " get" + initcap(colname) + "(){\r\n");
			sb.append("\t\treturn " + colname + ";\r\n");
			sb.append("\t}\r\n");
		}
		
	}
public void boToEntity(StringBuffer sb){
	sb.append("\tpublic static "+initcap(tablename)+" boToEntity(" + initcap(tablename) + " bo){");
	sb.append("\r\n\t"+initcap(tablename)+" entity=new "+initcap(tablename)+"();\r\n");
	for (int i = 0; i < colnames.length; i++) {
		String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
		sb.append("\tentity.set" + initcap(colname) + "(bo.get" +initcap(colname) + "());\r\n");
	}
	sb.append("\treturn entity;\r\n\t}\r\n");
}
public void entityToBo(StringBuffer sb){
	sb.append("\tpublic static "+initcap(tablename)+" entityToBo(" + initcap(tablename) + " bo){");
	sb.append("\r\n\t"+initcap(tablename)+" entity=new "+initcap(tablename)+"();\r\n");
	for (int i = 0; i < colnames.length; i++) {
		String colname=replaceUnderlineAndfirstToUpper(colnames[i].toLowerCase(),"_","");//将数据库列转小写，去掉下划线并首字母大写
		sb.append("\tentity.set" + initcap(colname) + "(bo.get" +initcap(colname) + "());\r\n");
	}
	sb.append("\treturn entity;\r\n\t}\r\n");
}

public String removeUnderLineAndFirstToUpper(String value){
	String result=replaceUnderlineAndfirstToUpper(value,"_","");//将数据库列转小写，去掉下划线并首字母大写
	return result;
}
	/**
	 * 功能：将输入字符串的首字母改成大写
	 * @param str
	 * @return
	 */
	private String initcap(String str) {
		
		char[] ch = str.toCharArray();
		if(ch[0] >= 'a' && ch[0] <= 'z'){
			ch[0] = (char)(ch[0] - 32);
		}
		
		return new String(ch);
	}

	/**
	 * 功能：获得列的数据类型
	 * @param sqlType
	 * @return
	 */
	private String sqlType2JavaType(String sqlType) {
		
		if(sqlType.equalsIgnoreCase("bit")){
			return "boolean";
		}else if(sqlType.equalsIgnoreCase("tinyint")){
			return "byte";
		}else if(sqlType.equalsIgnoreCase("smallint")){
			return "short";
		}else if(sqlType.equalsIgnoreCase("int")){
			return "int";
		}else if(sqlType.equalsIgnoreCase("bigint")){
			return "long";
		}else if(sqlType.equalsIgnoreCase("float")){
			return "float";
		}else if(sqlType.equalsIgnoreCase("decimal") || sqlType.equalsIgnoreCase("numeric") 
				|| sqlType.equalsIgnoreCase("real") || sqlType.equalsIgnoreCase("money") 
				|| sqlType.equalsIgnoreCase("smallmoney")){
			return "double";
		}else if(sqlType.equalsIgnoreCase("varchar") || sqlType.equalsIgnoreCase("char") 
				|| sqlType.equalsIgnoreCase("nvarchar") || sqlType.equalsIgnoreCase("nchar") 
				|| sqlType.equalsIgnoreCase("text")){
			return "String";
		}else if(sqlType.equalsIgnoreCase("datetime")){
			return "Date";
		}else if(sqlType.equalsIgnoreCase("image")){
			return "Blod";
		}
		
		return null;
	}
	
	/**
	 * 出口
	 * TODO
	 * @param args
	 */
	public static void main(String[] args) {
		
		new GeneratorToIbatisXmlForOracle();
		
	}

}